
Vue.component('c-datetime-picker', {
  template:`
  <el-date-picker
    v-model="value"
    :type="type"
    :format="format"
    :value-format="format"
    :placeholder="placeholder">
  </el-date-picker>
  `,
  data() {
    return {}
  },
  props: {
    value: {
      default: ""
    },
    placeholder: {
      default: "选择时间"
    },
    format: {
      default: "yyyy-MM-dd HH:mm:ss"
    },
    type: {
      default: "datetime"
    }
  },
  watch: {
    value(newName, oldName) {
      this.$emit('input', this.value);
    }
  }

});

Vue.component('c-date-picker', {
  template:`
  <el-date-picker
    v-model="value"
    type="datetime"
    :format="format"
    :value-format="format"
    :placeholder="placeholder">
  </el-date-picker>
  `,
  data() {
    return {}
  },
  props: {
    value: {
      default: ""
    },
    placeholder: {
      default: "选择日期"
    },
    format: {
      default: "yyyy-MM-dd"
    },
    type: {
      default: "date"
    }
  },
  watch: {
    value(newName, oldName) {
      this.$emit('input', this.value);
    }
  }

});
